const mongoose = require("mongoose");
const Schema = mongoose.Schema;

// create Schema  创建数据格式
const UserSchema = new Schema({
    username: {
        type: String,
        required: true
    },
    email: {
        type: String,
        required: true
    },
    password: {
        type: String,
        required: true
    },
    avatar: {
        type: String
    },
    date: {
        type: Date,
        default: Date.now
    },
    identity: {
        type: Array,
        required: true
    }
})
module.exports = User = mongoose.model("users", UserSchema);
